package com.yanqu.road.entity.activity.stronghold;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_u_stronghold_battle_data", desc = "据点战玩家个人信息")
public class StrongholdWarUserData extends DataObject {
    @FieldTypeAnnotation(select = true, update = true, desc = "用户id")
    private long userId;
    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;
    @FieldTypeAnnotation(desc = "剩余体力")
    private int power;
    @FieldTypeAnnotation(desc = "上次恢复体力时间")
    private long lastRestoreTime;
    @FieldTypeAnnotation(desc = "派遣到野外据点的门客")
    private int wildPatronsId;
    @FieldTypeAnnotation(desc = "是否派遣到野外据点")
    private boolean enterWild;
    private String event;
    private int tradeAddress;
    private int resetPatronsTimeId;
    private String guide = "0|0|0";

    public long getUserId() {
        return userId;
    }

    public int getActivityId() {
        return activityId;
    }

    public int getPower() {
        return power;
    }

    public long getLastRestoreTime() {
        return lastRestoreTime;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }

    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }

    }

    public void setPower(int power) {
        if (this.power != power) {
            this.power = power;
            setOp(DataStatus.Update);
        }

    }

    public void setLastRestoreTime(long lastRestoreTime) {
        if (this.lastRestoreTime != lastRestoreTime) {
            this.lastRestoreTime = lastRestoreTime;
            setOp(DataStatus.Update);
        }
    }

    public int getWildPatronsId() {
        return wildPatronsId;
    }

    public void setWildPatronsId(int wildPatronsId) {
        this.wildPatronsId = wildPatronsId;
    }

    public boolean isEnterWild() {
        return enterWild;
    }

    public void setEnterWild(boolean enterWild) {
        this.enterWild = enterWild;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getEvent() {
        return event;
    }

    public int getTradeAddress() {
        return tradeAddress;
    }

    public void setTradeAddress(int tradeAddress) {
        this.tradeAddress = tradeAddress;
        setUpdateOption();
    }

    public int getResetPatronsTimeId() {
        return resetPatronsTimeId;
    }

    public void setResetPatronsTimeId(int resetPatronsTimeId) {
        this.resetPatronsTimeId = resetPatronsTimeId;
        setUpdateOption();
    }

    public String getGuide() {
        return guide;
    }

    public void setGuide(String guide) {
        if (!Objects.equals(this.guide, guide)) {
            this.guide = guide;
            setUpdateOption();
        }
    }
}
